<template>
  <f7-page>
    <f7-navbar title="查询结果" back-link="Back"></f7-navbar>
    <f7-list media-list v-for="(order, index) in object" :key="index">
      <f7-list-item
        :title="order.name"
        :after="order.type"
        :subtitle="order.time"
        :text="order.price"
      >
        <img slot="media" :src="`data:image/jpeg;base64,${order.Photo}`" width="80">
      </f7-list-item>
    </f7-list>
  </f7-page>
</template>
<script>
import axios from "axios";
export default {
  data() {
    return {
      object: []
    };
  },
  mounted() {
    this.selectOrder();
  },
  methods: {
    selectOrder() {
      const self = this;
      const app = self.$f7;
      self.$f7.dialog.preloader("加载中");
      URL = "/caofuying/Booking/selectCustomer";
      axios
        .get(URL, {
          params: {
            Name: this.$store.state.ordercondition.name,
            center: this.$store.state.ordercondition.center
          }
        })
        .then(r => {
          const { data } = r;
          if (data != null) {
            this.object = data;
            self.$f7.dialog.close();
          } else {
            app.dialog.alert("服务器错误");
          }
        });
    }
  }
};
</script>